home *** CD-ROM | disk | FTP | other *** search
/ USA Bestseller / USA BESTSELLER Vol 1-95 (Hepp-Computer)(1995).iso / e004 / yesno.btm < prev   
Text File  |  1994-07-29  |  953b  |  49 lines

  1. @echo off
  2. :YESNO.BTM
  3. REM if below line 24, scroll screen and re-position cursor
  4. iff %_row gt 23 then
  5.   echo   ^ Screen 23 0
  6. endiff
  7. Set Def=%@upper[%1]
  8. Set Loops=0
  9. echos %2&
  10. Set CurX=%@eval[%_column + 2]
  11. Set CurY=%_row
  12. :Invalid
  13. Set Loops=%@eval[%Loops + 1]
  14. Gosub DisplayAns
  15. Screen %CurY %CurX
  16. Inkey /w20 %%Ans
  17. Screen %CurY %CurX
  18. iff "%Ans" eq "Y" then
  19.   Echo YES
  20.   Goto OK
  21. elseiff "%Ans" eq "N" then
  22.   Echo NO 
  23.   Goto OK
  24. elseiff "%Ans" eq "X" then
  25.   Echo HALT
  26.   Goto OK
  27. endiff
  28. iff %Loops gt 2 then
  29.   Set Ans=%Def
  30.   Goto OK
  31. endiff
  32. echos ***
  33. Beep 523 3 587 3 527 3 587 3 523 8
  34. goto Invalid
  35. :DisplayAns
  36. iff "%Def" eq "Y" then
  37.   ScrPut %CurY %CurX BRIght BLInk YELlow on BLAck YES
  38. else
  39.   ScrPut %CurY %CurX BRIght BLInk YELlow on BLAck NO 
  40. endiff
  41. Return
  42. :OK
  43. Set ANSWER=%@upper[%Ans]
  44. color WHIte on BLAck
  45. Unset CurY CurX Def Ans loops
  46. iff "%ANSWER" eq "X" then
  47.   Unset Answer ^ Abort Aborted by Operator
  48. endiff
  49.